package cn.bsb.controller.rece;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.alibaba.fastjson.JSONArray;
import com.github.pagehelper.PageInfo;

import cn.bsb.pojo.Thematic;
import cn.bsb.service.rece.ThematicService;

@Controller
public class ThematicControll {
	@Resource(name="ThematicService")
	private ThematicService thematicService ;
	  @RequestMapping("Thematics")
	  public ModelAndView getThematics(@RequestParam(name="pageIndex",required=false)String pageNum) {
		  ModelAndView mav=new ModelAndView();
		  Integer _pageNum=0;
		  if(pageNum!=null&&!pageNum.equals("")){
			  _pageNum= Integer.parseInt(pageNum);
		  }
		  PageInfo<Thematic> list=thematicService.getThematicListByPage(_pageNum, 12);
		  mav.addObject("ThematicPageInfo", list);
		  mav.setViewName("rece/thematiclist");;
		  return mav;
	  } 
	/*	@RequestMapping("indexs")
		public String inIndex() {
			return "rece/thematiclist";
			
		}*/
}
